Org provides methods to create a link in the correct syntax, to insert it into an Org file, and to follow the link.
org-store-link)Org-mode buffers
For Org files, if there is a ‘<<target>>’ at the
cursor, the link points to the target. Otherwise it points to
the current headline, which will also be the description.
If the headline has a
CUSTOM_ID property, a link to this custom ID
will be stored. In addition or alternatively (depending on
the value of org-link-to-org-use-id), a globally
unique ID property will be created and/or used
to construct a link. So using this command in Org buffers
will potentially create two links: a human-readable from the
custom ID, and one that is globally unique and works even if
the entry is moved from file to file. Later, when inserting
the link, you need to decide which one to use.
Email/News clients: VM, Rmail, Wanderlust, MH-E,
Gnus
Pretty much all Emacs mail clients are supported. The link
will point to the current article, or, in some GNUS buffers,
to the group. The description is constructed from the author
and the subject.
Web browsers: W3 and W3M
Here the link will be the current URL, with the page title as
description.
Contacts: BBDB
Links created in a BBDB buffer will point to the current
entry.
Chat: IRC
For IRC
links, if you set the variable
org-irc-link-to-logs to t, a
‘file:/’
style link to the relevant point in the logs for the current
conversation is created. Otherwise an
‘irc:/’
style link to the user/channel/server under the point will be
stored.
Other files
For any other files, the link will point to the file, with a
search string (see Search options)
pointing to the contents of the current line. If there is an
active region, the selected words will form the basis of the
search string. If the automatically created link is not
working correctly or accurately enough, you can write custom
functions to select the search string and to do the search
for particular file types—see Custom searches.
The key binding C-c l is only a
suggestion—see Installation.
Agenda view
When the cursor is in an agenda view, the created link points
to the entry referenced by the current line.
org-insert-link)Inserting stored links
All links stored during the current session are part of the
history for this prompt, so you can access them with
<up> and <down> (or M-p/n).
Completion support
Completion with <TAB> will help you to insert valid
link prefixes like ‘http:’ or
‘ftp:’,
including the prefixes defined through link abbreviations
(see Link
abbreviations). If you press <RET> after inserting
only the prefix, Org will offer specific
completion support for some link types3 For example,
if you type file <RET>, file name completion
(alternative access: C-u C-c C-l, see below) will
be offered, and after bbdb <RET> you can
complete contact names.
org-open-at-point)org-file-apps. If you want to override the default
application and visit the file with Emacs, use a C-u
prefix. If you want to avoid opening in Emacs, use a C-u
C-u prefix.org-return-follows-link is set,
<RET> will also follow the link at point.
org-toggle-inline-images)org-startup-with-inline-images5. org-mark-ring-push)org-mark-ring-goto)org-next-link)org-previous-link)
(add-hook 'org-load-hook
(lambda ()
(define-key 'org-mode-map "\C-n" 'org-next-link)
(define-key 'org-mode-map "\C-p" 'org-previous-link)))
[1] Note that you don't have to use this command to insert a link. Links in Org are plain text, and you can type or paste them straight into the buffer. By using this command, the links are automatically enclosed in double brackets, and you will be asked for the optional descriptive text.
[2] After insertion of a stored link, the
link will be removed from the list of stored links. To keep it
in the list later use, use a triple C-u prefix
argument to C-c C-l, or configure the option
org-keep-stored-link-after-insertion.
[3] This works by calling a special function
org-PREFIX-complete-link.
[4] See the variable
org-display-internal-link-with-indirect-buffer
[5] with corresponding #+STARTUP
keywords inlineimages and
inlineimages